package com.hmall.user.web;

import com.hmall.user.pojo.User;
import com.hmall.user.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;


    @GetMapping("/{id}")
    public User findById(@PathVariable Long id, HttpServletRequest request){
        String authorization = request.getHeader("authorization");
        log.warn("authorization-----UserService中的------------->{}",authorization);
        User byId = userService.getById(id);
        log.warn("TEST-----userservice中---------->{}", request.getHeader("test"));
        return byId;
    }



}
